<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>注册</title>
	<script src="/1/Public/js/jquery-1.8.3.min.js" ></script>
</head>
<body>
	<form action="/1/index.php/Home/User/add" method="post">
		班级：<select name="class">
					<option value="">--请选择--</option>
					<?php if(is_array($class)): foreach($class as $key=>$row): ?><option value="<?php echo ($row['id']); ?>"><?php echo ($row['name']); ?></option><?php endforeach; endif; ?>
			  </select><br>
		姓名：<input type="text" name="name" id="name" ><span></span><br>
		密码：<input type="password" name="password" id="password" placeholder="6-18位密码" ><span style="color:red;font-size:12px" ></span><br>
		密码确认：<input type="password" name="repassword" id="repassword" ><span style="color:red;font-size:12px" ></span><br>
		性别：<input type="radio" name="sex" value="1" >男
			  <input type="radio" name="sex" value="0" >女<br>
		身份证号：<input type="text" name="card" id="card" ><span style="color:red;font-size:12px" ></span><br>
		籍贯：<input type="text" name="address" ><br>
		联系电话：<input type="text" name="phone" id="phone" ><span style="color:red;font-size:12px" ></span><br>
		QQ：<input type="text" name="qq" ><br>
		E-mail：<input type="text" name="email" ><br>
		毕业院校所在省：<input type="text" name="school_address" ><br>
		毕业学校：<input type="text" name="school" ><br>
		学历：<select name="education">
					<option value="">--请选择--</option>
					<option value="初中">初中</option>
					<option value="高中">高中</option>
					<option value="中专">中专</option>
					<option value="大专">大专</option>
					<option value="本科">本科</option>
					<option value="本科以上">本科以上</option>
			  </select><br>
		专业：<input type="text" name="subject" ><br>
		计算机基础：<select name="computer" >
							<option value="">--请选择--</option>
							<option value="0">零基础</option>
							<option value="1">有一点点基础</option>
							<option value="2">计算机操作还可以</option>
							<option value="3">学过编程语言</option>
							<option value="4">有PHP编程基础</option>
							<option value="5">从事过PHP工作</option>
						</select><br>
		工作经验(年)：<input type="text" name="work_year" ><br>
		目标月薪(元)：<input type="text" name="target" ><br>
		紧急联系人姓名：<input type="text" name="contacts_name" ><br>
		与紧急联系人关系：<input type="text" name="contacts_relation"><br>
		紧急联系人电话：<input type="text" name="contacts_phone" ><br>

			<input type="submit" value="提交">
			<input type="reset" value="重置">
	</form>
</body>
	<script>

		demo = false;

		//密码验证
		$("#password").blur(function(){
			password = $(this).val();
			$.ajax({
				"type":"post",
				"url":"<?php echo U('User/preg_password');?>",
				"data":{password:password},
				"dataType":"text",
				success:
				function(data){
					$("#password").next("span").html("<i>"+data+"<i>");
				}
			});
		});
		

		//确认密码验证
		$("#repassword").blur(function(){
			repassword = $(this).val();
			password = $("#password").val();
			$.ajax({
				"type":"post",
				"url":"<?php echo U('User/preg_repassword');?>",
				"data":{repassword:repassword,password:password},
				"dataType":"text",
				success:
				function(data){
					$("#repassword").next("span").html("<i>"+data+"<i>");
				}
			})
		});

		//身份证号验证
		$("#card").blur(function(){
			card = $(this).val();
			$.ajax({
				"type":"post",
				"url":"<?php echo U('User/preg_card');?>",
				"data":{card:card},
				"dataType":"text",
				success:
				function(data){
					$("#card").next("span").html("<i>"+data+"<i>");
				}
			})
		});

		//电话验证
		$("#phone").blur(function(){
			phone = $(this).val();
			$.ajax({
				"type":"post",
				"url":"<?php echo U('User/preg_phone');?>",
				"data":{phone:phone},
				"dataType":"text",
				success:
				function(data){
					$("#phone").next("span").html("<i>"+data+"<i>");
				}
			})
		});

	</script>
</html>